<script type="text/javascript">
	$(function() {
		$('#edg').edatagrid({
			fit : true
		});
		
	});
	
</script>

<form id="addForm" method="post">
	<div id="formHead" style="margin: 5px 10px 5px 10px; height: 25px;">
		<div style="float: left;">
			凭证字号：记&nbsp;<label id="voucherId"></label>&nbsp;号
		</div>
		<div style="float: left; margin-left: 40px;">
			日期：<input id="date" type="text" class="easyui-datebox"
				data-options="width: 100" />
		</div>
		<div style="float: right;">
			制单人： <label id="maker" >${session["loginUser"].name}</label>
		</div>
	</div>
	<div style="margin: 5px 10px 5px 10px;">
		<a class="easyui-linkbutton" iconCls="icon-add" plain="true" href="#"
			onclick="javascript:$('#edg').edatagrid('addRow')" title="添加新的一行">新增行</a>
		<span class="toolbar-item dialog-tool-separator"></span> <a
			class="easyui-linkbutton" iconCls="icon-save" plain="true" href="#"
			onclick="javascript:$('#edg').edatagrid('saveRow')"
			title="保存行，退出编辑模式">保存行</a> <span
			class="toolbar-item dialog-tool-separator"></span> <a
			class="easyui-linkbutton" iconCls="icon-remove" plain="true" href="#"
			onclick="javascript:$('#edg').edatagrid('destroyRow')"
			title="删除行">删除行</a>
	</div>
	<div id="formBody" style="margin: 5px 10px 5px 10px; height: 250px;">
		<table id="edg" class="formTable" data-options="singleSelect:true">
			<thead>
				<tr>
					<th align="center" width="140px" data-options="field:'summary'"
						editor="{type:'validatebox',options:{ required: true }}" >摘要</th>
					<th align="center" width="140px" data-options="field:'captionId'"
						editor="{type:'combobox',options:{
	    						url: 'http://localhost:8080/fms/accountCaption/getMenu2',  
                            	valueField: 'captionId',  
                            	textField: 'name',  
                            	editable: false,
                            	required: true,
	    						panelHeight:150
                            }}">会计科目</th>
					<th align="center" width="140px" data-options="field:'debitAmount'"
						editor="{type:'numberbox',options:{min:0,precision:2}}">借方金额</th>
					<th align="center" width="140px"
						data-options="field:'creditAmount'" editor="{type:'numberbox',options:{min:0,precision:2}}">贷方金额</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="formFoot" style="margin: 0px 10px 5px 10px; float: right;">
		合计：借方金额：<label id="debitAmount"></label>
		&nbsp;&nbsp;&nbsp;贷方金额：<label id="creditAmount">  </label>
	</div>
</form>